# Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
# This source file is part of the Cangjie project, licensed under Apache-2.0
# with Runtime Library Exception.
#
# See https://cangjie-lang.cn/pages/LICENSE for license information.

file(GLOB ALL_DIRECTORIES LIST_DIRECTORIES true "*")
set(VERSIONS "")
foreach(DIRECTORIE ${ALL_DIRECTORIES})
    if(IS_DIRECTORY ${DIRECTORIE})
        get_filename_component(VERSION "${DIRECTORIE}" NAME)
        list(APPEND VERSIONS ${VERSION})
    endif()
endforeach()

add_definitions(-DCANGJIE_AST2CHIR2)

message("Found version:")
foreach(VERSION ${VERSIONS})
    message(${VERSION})
    add_subdirectory(${VERSION})
endforeach()
